package org.mtmi.ui.controls.edits;

import org.eclipse.swt.graphics.Color;
import org.mtmi.ui.controls.Control;
import org.mtmi.ui.controls.Knob;
import org.mtmi.ui.drawables.IColorDrawable;
import org.mtmi.ui.drawables.KnobValueColorDrawable;

/**
 * Action to change Knob value color.
 */
public class KnobValueColorAction extends AbstractChooseColorAction 
{

	@Override
	protected Color getColor( Control control ) {
		return ((Knob)control).getValueColor();
	}
	
	@Override
	protected void setColor( Control k, Color c ) {
		((Knob)k).setValueColor( c );
	}

	@Override
	public boolean isControlHandled( Control c ) {
		return c instanceof Knob;
	}
	
	@Override
	protected IColorDrawable createColorDrawable() {
		return new KnobValueColorDrawable( null );
	}

}
